import re

query = "介绍一下商品ID为100007的商品"
match = re.search(r'(?:商品ID|ID|编号)\s*[为:：]?\s*(\d{6})', query)
print(match)  # None!